package nc.ui.acm.basicdoc.accounttype;

import nc.itf.acm.pub.ACMInterface;
import nc.ui.trade.pub.IVOTreeDataByID;
import nc.vo.acm.basicdoc.accounttype.AccounttypedefVO;
import nc.vo.logging.Debug;
import nc.vo.pub.BusinessException;
import nc.vo.pub.SuperVO;

public class AccountTypeTreeData implements IVOTreeDataByID {
	
	private String pk_corp = null;
	public AccountTypeTreeData(String pk_corp) {
		super();
		this.pk_corp=pk_corp;
	}

	public String getIDFieldName() {
		return AccounttypedefVO.PK_ACCOUNTTYPEDEF;
	}

	public String getParentIDFieldName() {
		return AccounttypedefVO.PK_PARENT;
	}

	public String getShowFieldName() {
		return AccounttypedefVO.ACCOUNTTYPECODE;
	}

	public SuperVO[] getTreeVO() {
		SuperVO[] m_headVos = null;
		try {
			m_headVos=ACMInterface.getIAccountType().queryAccounttypeVOs(pk_corp).toArray(new SuperVO[0]);
		} catch (BusinessException e) {
			Debug.error(e.getMessage());
		}
		return m_headVos;
	}

}
